import request from '@/utils/request'

// 查询基础物料列表
export function listGoods(query) {
  return request({
    url: '/system/goods/list',
    method: 'get',
    params: query
  })
}

// 根据id查询基础物料详细
export function getGoods(id) {
  return request({
    url: '/system/goods/byId/' + id,
    method: 'get'
  })
}
// 根据物料id查询基础物料详细
export function getGoodsByMaterialId(materialId) {
  return request({
    url: '/system/goods/byMaterialId/' + materialId,
    method: 'get'
  })
}

// 新增基础物料
export function addGoods(data) {
  return request({
    url: '/system/goods',
    method: 'post',
    data: data
  })
}

// 修改基础物料
export function updateGoods(data) {
  return request({
    url: '/system/goods',
    method: 'put',
    data: data
  })
}

// 删除基础物料
export function delGoods(id) {
  return request({
    url: '/system/goods/' + id,
    method: 'delete'
  })
}
// 查询库存(首页展示)
export function queryInventory(){
  return request({
    url: '/system/goods/inventory',
    method: 'get'
  })
}
//查询首页显示的五个数据
export function queryData(){
  return request({
    url: '/system/hospital/getInfo',
    method: 'get'
  })
}
//查询折线统计图数据
export function queryLineChartData(){
  return request({
    url: '/system/goods/lineChart',
    method: 'get'
  })
}
//查询总金额
export function queryTotal(){
  return request({
    url: '/system/goods/total',
    method: 'get'
  })
}

